from configparser import ConfigParser
from common.path_handle import Config


class MyConfig(ConfigParser):
    """获取配置信息"""
    def __init__(self):
        super().__init__()

        self.read(Config.config_path, encoding='utf_8')

    def __str__(self):
        return 'config object'


myconf = MyConfig()


if __name__ == '__main__':
    text = myconf.get("MYSQL", "port")
    print(text, type(text))